/*
 * Copyright (c) 2002-2006 by OpenSymphony
 * All rights reserved.
 */
package org.fordprefect.struts2lightboxplugin.views.jsp.ui;

import com.opensymphony.xwork2.util.ValueStack;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractUITag;
import org.fordprefect.struts2lightboxplugin.components.Head;

/**
 * @see Head
 */
public class HeadTag extends AbstractUITag {

    private String debug;

    public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
        return new Head(stack, req, res);
    }

    protected void populateParams() {
        super.populateParams();
        if (debug != null) {
        	((Head) component).setDebug(Boolean.valueOf(debug).booleanValue());
        }
    }   

    public void setDebug(String debug) {
        this.debug = debug;
    }
}
